﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<EventViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Details
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Event Detailseite</h2>


<fieldset>
<div id="EventDetails">
<h3>Daten des Events</h3>
<div class="displayEvent-row ">
    <div class="displayEvent-label">Titel</div>
    <div class="displayEvent-field"><%: Model.Title %></div>
</div>

<div class="displayEvent-row ">
    <div class="displayEvent-label">Beschreibung</div>
    <div class="displayEvent-field"><%: Model.Description %></div>
</div>
<div class="displayEvent-row ">
    <div class="displayEvent-label">Addresse</div>
    <div class="displayEvent-field"><%: Model.Addresse %></div>
</div>
<div class="displayEvent-row ">
    <div class="displayEvent-label">PLZ</div>
    <div class="displayEvent-field"><%: Model.ZipCode %></div>
</div>
<div class="displayEvent-row ">
    <div class="displayEvent-label">Stadt</div>
    <div class="displayEvent-field"><%: Model.City %></div>
</div>
<div class="displayEvent-row ">
    <div class="displayEvent-label">Beginn</div>
    <div class="displayEvent-field"><%: String.Format("{0:g}", Model.StartDate) %></div>
</div>
<div class="displayEvent-row ">
    <div class="displayEvent-label">Ende</div>
    <div class="displayEvent-field"><%: String.Format("{0:g}", Model.EndDate) %></div>
</div>
<div class="displayEvent-row ">
    <div class="displayEvent-label">
    <% if (Model.isAdmin == true) %>
        <% { %>
            <%: Html.ActionLink("Bearbeiten", "Edit", new { Model.Id }) %>
        <% } %>
    </div>
</div>
</div>
<div id="EventOptions">
<h3>Willst Du teilnehmen?</h3>
    <div class="display-label"><%: Html.ActionLink("Teilnehmen", "EventOptIn", new { id=Model.Id, data="Yes" } )%></div>
    <div class="display-label"><%: Html.ActionLink("Absagen", "EventOptIn", new { id = Model.Id, data = "No" } )%></div>
    <div class="display-label"><%: Html.ActionLink("Weiß noch nicht", "EventOptIn", new { id = Model.Id, data = "Maybe" } )%></div>
    <div class="display-label"><%: Html.ActionLink("Ich hab Angst", "EventOptIn", new { id = Model.Id, data = "Probably Not" } )%></div>
</div>
</fieldset>

<div>

<table>
    <tr>
        <th>
            Vorname Nachname
        </th>
        <th>
            Teilnahme
        </th>
    </tr>

<% foreach (var item in Model.UserEventAttendance) { %>
    <tr>
        <td>
            <%: Html.ActionLink(item.User.Firstname + " "+ item.User.Lastname, "Details", "User", new { id = item.User.Id }, null)%>
        </td>
        <td>
           <%: item.Attendance %>
        </td>
    </tr>  
<% } %>

</table>

</div>

<p>    
    <%: Html.ActionLink("Zurück zur Liste", "Index") %>
</p>




</asp:Content>

